<template>
  <div class="content">
    <el-table :data="studentList" style="width: 100%">
      <el-table-column prop="id" label="id" width="180">
      </el-table-column>
      <el-table-column prop="name" label="姓名" width="180">
      </el-table-column>
      <el-table-column prop="class_times"  sortable label="参加表达课次数">
      </el-table-column>
      <el-table-column prop="age" label="年龄">
      </el-table-column>
      <el-table-column prop="school" label="毕业院校">
      </el-table-column>
      <el-table-column prop="edu_level_str" label="学历">
      </el-table-column>
      <el-table-column prop="now_salary_str" sortable  label="目前薪资水平">
      </el-table-column>
      <el-table-column prop="hope_salary_str" sortable label="期望薪资水平">
      </el-table-column>

      <el-table-column label="操作" width="100">
        <template scope="scope">
          <el-button @click="studentDetail(scope.$index)" type="text" size="small">详情</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { getStudentList } from 'api/remoteSearch'
export default {
  data() {
    return {
      studentList: [

      ]
    }
  },
  created() {

  },
  mounted() {
    this.fetchStudentList();
  },
  methods: {
    getAge(birthday) {
      return birthday;
    },
    fetchStudentList() {
      let vm = this;
      getStudentList()
        .then(function (res) {
          if (res.data.status == 'success') {
            vm.studentList = res.data.data;
          }
          console.log(res)
        })
        .catch(err => {
          console.log(err)
        })
    },
    studentDetail(index) {
      //学生详情
      console.log(index)
      let id=this.studentList[index].id;
      this.$router.push({path:"/student/"+id})
    }
  }
}
</script>

<style>
</style>
